Page({
    //添加缓存
    handleSet(){
        wx.setStorageSync('user', "张三")
        wx.setStorageSync("address",['北京','上海','广州'])
        let users=[
            {id:1001,name:"八戒",weight:100},
            {id:1002,name:"悟空",weight:200},
            {id:1003,name:"唐僧",weight:300}
        ]
        wx.setStorageSync('users', users)
    },
    //删除缓存
    handleRemove(){
        //同步删除缓存
        // wx.removeStorageSync('address')

        //异步删除缓存
        wx.removeStorage({
          key: 'user',
        })

    },
    //更改缓存
    handleUpdate(){
        //查询缓存
       let users= wx.getStorageSync('users')
       //修改数据
        users[0].weight=60
        //存储缓存
        wx.setStorageSync('users', users)
    },
    //清除缓存
    handleClear(){
        wx.clearStorageSync()
    }
})